package com.example.demo.repository;

import com.example.demo.model.LinkCategory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface LinkCategoryRepository extends JpaRepository<LinkCategory, Long> {
    
    /**
     * 根据显示顺序查找所有分类
     */
    List<LinkCategory> findByOrderByDisplayOrderAsc();
    
    /**
     * 根据名称查找分类
     */
    Optional<LinkCategory> findByName(String name);
} 